package com.newbee.service;

import com.newbee.model.demo.DemoRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class DemoServiceB {

    @Autowired
    private DemoServiceC demoServiceC;

    @Autowired
    private DemoServiceD demoServiceD;

    @Autowired
    private DemoServiceF demoServiceF;

    public int funcB(DemoRequest req) {
        int x = demoServiceC.funcC(req.getX());
        int y = demoServiceD.funcD(x);
        try {
            demoServiceF.testErrorF();
        } catch (Exception e) {
            log.error("实际业务不会抛出异常, 会吞并做处理正常返回, 所以前端感知不到失败");
        }
        return y;
    }
}
